import org.apache.catalina.startup.Tomcat;

import javax.servlet.ServletException;

public class SpringBootApplication {

    public static void  run() throws Exception {
        Tomcat tomcat = new Tomcat();
        //设置端口
        tomcat.setPort(7071);
        //设置项目路径
        tomcat.addWebapp("/","D:/");
        tomcat.start();
        tomcat.getServer().wait();
    }
}
